using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TablePictures
	{
		public const string Table = "Pictures";
		public const string PictureID = "PictureID";
		public const string PictureTypeID = "PictureTypeID";
		public const string ObjectID = "ObjectID";
		public const string ImageUrl = "ImageUrl";
		public const string Creater = "Creater";
		public const string CreatedBy = "CreatedBy";
		public const string Created = "Created";
		public const string Modified = "Modified";
		public const string ModifiedBy = "ModifiedBy";
		public const string ModifiedByID = "ModifiedByID";
		public const string Sort = "Sort";
	}
	
	[Serializable]
	public class BasePictures
		: IDbSessionEntity, IJsonClass
	{
		int m_PictureID;
		/// <summary>
        /// 图片表ID
        /// </summary>
        public int PictureID
        {
            get { return m_PictureID; }
            set { m_PictureID = value; }
        }
		
		int m_PictureTypeID;
		/// <summary>
        /// 图片类型ID
        /// </summary>
        public int PictureTypeID
        {
            get { return m_PictureTypeID; }
            set { m_PictureTypeID = value; }
        }
		
		int m_ObjectID;
		/// <summary>
        /// 图片对象ID
        /// </summary>
        public int ObjectID
        {
            get { return m_ObjectID; }
            set { m_ObjectID = value; }
        }
		
		string m_ImageUrl;
		/// <summary>
        /// 图片URL
        /// </summary>
        public string ImageUrl
        {
            get { return m_ImageUrl; }
            set { m_ImageUrl = value; }
        }
		
		int m_Creater;
		/// <summary>
        /// 创建人ID
        /// </summary>
        public int Creater
        {
            get { return m_Creater; }
            set { m_Creater = value; }
        }
		
		string m_CreatedBy;
		/// <summary>
        /// 创建人名称
        /// </summary>
        public string CreatedBy
        {
            get { return m_CreatedBy; }
            set { m_CreatedBy = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		DateTime m_Modified;
		/// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		string m_ModifiedBy;
		/// <summary>
        /// 修改人
        /// </summary>
        public string ModifiedBy
        {
            get { return m_ModifiedBy; }
            set { m_ModifiedBy = value; }
        }
		
		int? m_ModifiedByID;
		/// <summary>
        /// 修改人ID
        /// </summary>
        public int? ModifiedByID
        {
            get { return m_ModifiedByID; }
            set { m_ModifiedByID = value; }
        }
		
		int m_Sort;
		/// <summary>
        /// 排序值
        /// </summary>
        public int Sort
        {
            get { return m_Sort; }
            set { m_Sort = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_PictureID = reader[TablePictures.PictureID];
            m_PictureTypeID = reader[TablePictures.PictureTypeID];
            m_ObjectID = reader[TablePictures.ObjectID];
            m_ImageUrl = reader[TablePictures.ImageUrl];
            m_Creater = reader[TablePictures.Creater];
            m_CreatedBy = reader[TablePictures.CreatedBy];
            m_Created = reader[TablePictures.Created];
            m_Modified = reader[TablePictures.Modified];
            m_ModifiedBy = reader[TablePictures.ModifiedBy];
            m_ModifiedByID = reader[TablePictures.ModifiedByID];
            m_Sort = reader[TablePictures.Sort];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TablePictures.PictureID, PrimaryKeyType.Identity, PictureID);
			writer[TablePictures.PictureTypeID] = PictureTypeID;
			writer[TablePictures.ObjectID] = ObjectID;
			writer[TablePictures.ImageUrl] = ImageUrl;
			writer[TablePictures.Creater] = Creater;
			writer[TablePictures.CreatedBy] = CreatedBy;
			writer[TablePictures.Created] = Created;
			writer[TablePictures.Modified] = Modified;
			writer[TablePictures.ModifiedBy] = ModifiedBy;
			writer[TablePictures.ModifiedByID] = ModifiedByID;
			writer[TablePictures.Sort] = Sort;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_PictureID = idd;
        }
		
		public string TableName
        {
            get { return TablePictures.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_PictureID = hashToRead["PictureID"];
			 
             m_PictureTypeID = hashToRead["PictureTypeID"];
			 
             m_ObjectID = hashToRead["ObjectID"];
			 
             m_ImageUrl = hashToRead["ImageUrl"];
			 
             m_Creater = hashToRead["Creater"];
			 
             m_CreatedBy = hashToRead["CreatedBy"];
			 
             m_Created = hashToRead["Created"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_ModifiedBy = hashToRead["ModifiedBy"];
			 
             m_ModifiedByID = hashToRead["ModifiedByID"];
			 
             m_Sort = hashToRead["Sort"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["PictureID"] = PictureID;
			 
            hashToFill["PictureTypeID"] = PictureTypeID;
			 
            hashToFill["ObjectID"] = ObjectID;
			 
            hashToFill["ImageUrl"] = ImageUrl;
			 
            hashToFill["Creater"] = Creater;
			 
            hashToFill["CreatedBy"] = CreatedBy;
			 
            hashToFill["Created"] = Created;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["ModifiedBy"] = ModifiedBy;
			 
            hashToFill["ModifiedByID"] = ModifiedByID;
			 
            hashToFill["Sort"] = Sort;
			 
        }

        #endregion
		
	}
}
